HanoiList = [0,2]
for i in range(2,100):
    HanoiList.append(3*HanoiList[i-1]+2)

while True:
    try:
        data = list(map(int, input().strip().split()))
        n = data[0]
        print(HanoiList[n])
    except EOFError:
        break